<%--
  Created by IntelliJ IDEA.
  User: taohj
  Date: 2014/6/29
  Time: 18:04
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<c:set value="1" var="index" scope="request"></c:set>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <base href="<%=basePath%>">
    <title>政府数据开放平台</title>
    <jsp:include page="../../commons/include.jsp"/>


    <style>
        .list thead > tr > th {
            padding-left: 20px;
            background-color: rgb(51, 204, 0);
            height: 40px;
            color: #fff;;
        }

        .list tbody > tr > td {

            min-height: 50px;
            padding: 8px 0 8px 20px;
            vertical-align: middle;
        }

        .list td > div:last-of-type {
            line-height: 20px;;
        }

        .list td > div:first-of-type {

        }

        .list td > div:first-of-type > a {
            text-decoration: none;
            color: #0000ff;
        }
    </style>
    
    <script>


       $(function(){

           $(".pagination li").each(function(){

               $(this).on('click',function(){

                   var page =$(this).attr("page");

                   $("input[name=page]").val(page);

                   $("form").submit();
               });
           });
       });
       /* $(".pagination li")*/
    </script>
</head>
<body>


<div class="main">
    <jsp:include page="../../commons/top.jsp"/>


    <form action="/front/front/data/search">

        <input type="hidden" name="page" value="1"/>
        <div>
            <div>
                <table cellpadding="0" cellspacing="0" border="0" style="width: 500px;margin: 50px auto 0 auto">
                    <tr>
                        <td><input type="text" name="key" value="${requestScope.result.pageResult.key}" style="width: 400px;"/></td>
                        <td><input type="submit" value="搜 索"/></td>
                        <td style="padding-left: 10px;"><input type="reset" onclick="location.href='/front/front/data/search';"  value="清空"/></td>
                    </tr>
                </table>

                <div style="overflow-y: auto;border: 1px solid rgb(197,197,197);margin-top: 60px;background-color: rgb(232,232,232);">
                    <div style="background-color: rgb(232,232,232);">
                        <ul style="list-style: none;">
                            <li href="/front/front/dataCatalogue/theme"
                                style="width: 100px;float: left;padding: 10px 0 10px 20px;font-size: 14px;font-weight: bold;">
                                主题
                            </li>
                            <li href="/front/front/dataCatalogue/org"
                                style="width: 100px;float: left;font-size: 14px;font-weight: bold;padding: 10px 0 10px 20px;">
                                机构
                            </li>
                            <li></li>
                        </ul>
                    </div>
                </div>
            </div>


            <div>

                <div style="padding: 20px 0 8px 190px;">
                    <div style="font-size: 16px; font-family:'微软雅黑'">找到<span
                            style="font-size: 18px;">${requestScope.result.pageResult.total}</span>条记录
                    </div>
                    <div>

                        <ul class="pagination" style="margin: 10px 0px;padding-left: 0;">
                            <li page="${requestScope.result.pageResult.startPage-1}">&laquo;</li>

                            <c:forEach begin="${requestScope.result.pageResult.startPage}"
                                       end="${requestScope.result.pageResult.endPage}" var="index">
                                <li page="${index}" <c:if
                                        test="${index==requestScope.result.pageResult.page}"> class="active" </c:if> >${index}
                                </li>
                            </c:forEach>

                            <li page="${requestScope.result.pageResult.endPage+1}">&raquo;</li>
                        </ul>
                        <div style="clear: both;"></div>

                    </div>

                </div>


            </div>

            <div style="width: 180px;float: left;min-height: 500px;">
                <div style="background-color: rgb(195,192,187);font-weight: bold;color: #fff;font-size: 14px;padding: 6px 0 6px 30px;height: 28px;">
                    过滤
                </div>
                <div style="text-align: center;padding: 8px;"><input type="submit"
                                                                     style="background-color: rgb(102,204,0)"
                                                                     value="过 滤"/></div>

                <div style="border: 1px solid rgb(205,205,205);width: 170px;margin-left: auto;">
                    <div style="font-size: 14px;background-color: rgb(205,205,205); padding: 6px 0 6px 20px;">主题</div>
                    <div style="padding-left: 20px;padding-top: 10px;height: 200px; overflow-y: auto;">
                        <ul style="list-style: none">
                            <c:forEach items="${requestScope.themes.list}" var="theme">
                                <li style="line-height: 20px"><input type="checkbox" name="theme"

                                                                     <c:if test="${not empty requestScope.theme}">
                                                                         <c:forEach items="${requestScope.theme}" var="theme1">
                                                                             <c:if test="${theme.id==theme1}">checked</c:if>
                                                                         </c:forEach>
                                                                     </c:if>
                                                                     value="${theme.id}"/><label>${theme.name}</label>
                                </li>
                            </c:forEach>

                        </ul>
                    </div>
                </div>

                <div style="border: 1px solid rgb(205,205,205);margin-top: 10px;width: 170px;margin-left: auto;">
                    <div style="font-size: 14px;background-color: rgb(205,205,205); padding: 6px 0 6px 20px;">机构</div>
                    <div style="padding-left: 20px;padding-top: 10px;height: 200px; overflow-y: auto;">
                        <ul style="list-style: none">


                            <c:forEach items="${requestScope.orgs.list}" var="org">
                                <li style="line-height: 20px"><input type="checkbox" name="org"
                                        <c:forEach items="${requestScope.org}" var="org1">
                                            <c:if test="${org.id==org1}">checked</c:if>
                                        </c:forEach>
                                                                     value="${org.id}"/><label>${org.name}</label></li>
                            </c:forEach>

                        </ul>
                    </div>
                </div>


                <div style="border: 1px solid rgb(205,205,205);margin-top: 10px;width: 170px;margin-left: auto;">
                    <div style="font-size: 14px;background-color: rgb(205,205,205); padding: 6px 0 6px 20px;">格式</div>
                    <div style="padding-left: 20px;padding-top: 10px;height: 100px; overflow-y: auto;">
                        <ul style="list-style: none">
                            <c:forEach items="${requestScope.formats}" var="format">
                                <li style="line-height: 20px"><input type="checkbox" name="format"
                                        <c:forEach items="${requestScope.format}" var="format1">
                                            <c:if test="${format==format1}">checked</c:if>
                                        </c:forEach>
                                                                     value="${format}"/><label>${format}</label></li>
                            </c:forEach>

                        </ul>
                    </div>
                </div>
                <div style="text-align: center;padding: 8px;"><input type="submit"
                                                                     style="background-color: rgb(102,204,0)"
                                                                     value="过 滤"/></div>
            </div>


            <div style="width: 810px;float: left;padding-left: 1px;">
                <div style="min-height: 800px;">
                    <table cellspacing="0" cellpadding="0" border="0" style="width: 800px;" class="table list">
                        <thead>
                        <tr style="text-align: left;">
                            <th width="250">标题</th>
                            <th width="100">下载</th>
                            <th width="140">主题</th>
                            <th width="160">机构</th>
                            <th width="150">数据集</th>
                        </tr>
                        </thead>

                        <tbody>

                        <c:forEach items="${requestScope.result.pageResult.rows}" var="data" varStatus="status">
                            <tr
                                    <c:if test="${status.count%2==0}">style="background-color: rgb(237,236,236)"</c:if> >
                                <td>
                                    <div style="font-size: 14px;font-weight: bold;"><a href="/front/front/data/view?id=${data.id}" target="_blank">${data.title}</a></div>
                                    <div style="margin-top: 0;">&nbsp;&nbsp;&nbsp;${data.description}</div>
                                </td>
                                <td><a href="${data.url}">下载</a></td>
                                <td>${data.dataset.theme.name}</td>
                                <td>${data.dataset.org.name}</td>
                              <td>${data.dataset.name}</td>
                            </tr>
                        </c:forEach>


                        </tbody>
                    </table>
                </div>


                <div style="padding-left: 0px;">
                    <ul class="pagination">
                        <li page="${requestScope.result.pageResult.startPage-1}">&laquo;</li>

                        <c:forEach begin="${requestScope.result.pageResult.startPage}"
                                   end="${requestScope.result.pageResult.endPage}" var="index">
                            <li page="${index}" <c:if
                                    test="${index==requestScope.result.pageResult.page}"> class="active" </c:if> >${index}
                            </li>
                        </c:forEach>

                        <li page="${requestScope.result.pageResult.endPage+1}">&raquo;</li>
                    </ul>
                    <div style="clear: both;"></div>
                </div>
            </div>


        </div>
    </form>
</div>


</div>
<jsp:include page="../../commons/buttom.jsp"/>

</body>
</html>
